@echo off
set current_dir=%CD%
echo The command currently used is HDC_std
set hdc=hdc
for /f %%i in ('%hdc% list targets') do (
	echo Current hardware:%%i
                %hdc% -t %%i shell mount -o rw,remount /
	%hdc% -t %%i target mount
	echo Start deleting the original so:
	%hdc% -t %%i shell rm /system/lib64/libpasteboard_service.z.so
	%hdc% -t %%i shell rm /system/lib64/libpasteboard_framework.z.so
	%hdc% -t %%i shell rm /system/lib64/platformsdk/libcj_pasteboard_ffi.z.so
                %hdc% -t %%i shell rm /system/lib64/platformsdk/libpasteboard_client.z.so
                %hdc% -t %%i shell rm /system/lib64/ndk/libpasteboard.so
	echo File transfer in:
	%hdc% -t %%i file send %current_dir%\libpasteboard_service.z.so /system/lib64/
	%hdc% -t %%i file send %current_dir%\libpasteboard_framework.z.so /system/lib64/
	%hdc% -t %%i file send %current_dir%\libcj_pasteboard_ffi.z.so /system/lib64/platformsdk/
                %hdc% -t %%i file send %current_dir%\libpasteboard_client.z.so /system/lib64/platformsdk/
                %hdc% -t %%i file send %current_dir%\libpasteboard.so /system/lib64/ndk/
	echo File permission modification:
	%hdc% -t %%i shell reboot
)
pause